Skip to content

Conversation

@matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Dec 2, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

hkBst and others added 12 commits October 29, 2025 12:50
…ngjubilee

Rework `c_variadic`

tracking issue: rust-lang#44930
related PR: rust-lang#144529

On some platforms, the C `va_list` type is actually a single-element array of a struct (on other platforms it is just a pointer). In C, arrays passed as function arguments expirience array-to-pointer decay, which means that C will pass a pointer to the array in the caller instead of the array itself, and modifications to the array in the callee will be visible to the caller (this does not match Rust by-value semantics). However, for `va_list`, the C standard explicitly states that it is undefined behaviour to use a `va_list` after it has been passed by value to a function (in Rust parlance, the `va_list` is moved, not copied). This matches Rust's pass-by-value semantics, meaning that when the C `va_list` type is a single-element array of a struct, the ABI will match C as long as the Rust type is always be passed indirectly.

In the old implementation, this ABI was achieved by having two separate types: `VaList` was the type that needed to be used when passing a `VaList` as a function parameter, whereas `VaListImpl` was the actual `va_list` type that was correct everywhere else. This however is quite confusing, as there are lots of footguns: it is easy to cause bugs by mixing them up (e.g. the C function `void foo(va_list va)` was equivalent to the Rust `fn foo(va: VaList)` whereas the C function `void bar(va_list* va)` was equivalent to the Rust `fn foo(va: *mut VaListImpl)`, not `fn foo(va: *mut VaList)` as might be expected); also converting from `VaListImpl` to `VaList` with `as_va_list()` had platform specific behaviour: on single-element array of a struct platforms it would return a `VaList` referencing the original `VaListImpl`, whereas on other platforms it would return a cioy,

In this PR, there is now just a single `VaList` type (renamed from `VaListImpl`) which represents the C `va_list` type and will just work in all positions. Instead of having a separate type just to make the ABI work, rust-lang#144529 adds a `#[rustc_pass_indirectly_in_non_rustic_abis]` attribute, which when applied to a struct will force the struct to be passed indirectly by non-Rustic calling conventions. This PR then implements the `VaList` rework, making use of the new attribute on all platforms where the C `va_list` type is a single-element array of a struct.

Cleanup of the `VaList` API and implementation is also included in this PR: since it was decided it was OK to experiment with Rust requiring that not calling `va_end` is not undefined behaviour (rust-lang#141524 (comment)), I've removed the `with_copy` method as it was redundant to the `Clone` impl (the `Drop` impl of `VaList` is a no-op as `va_end` is a no-op on all known platforms).

Previous discussion: rust-lang#141524 and [t-compiler > c_variadic API and ABI](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/c_variadic.20API.20and.20ABI)
Tracking issue: rust-lang#44930
r? `@joshtriplett`
also introduce Peekable::next_if_map_mut next to next_if_map

As requested in rust-lang#148941 (comment) by `@joshtriplett`
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Dec 2, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Dec 2, 2025

📌 Commit 7158f11 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 2, 2025
bors added a commit that referenced this pull request Dec 2, 2025
Rollup of 4 pull requests

Successful merges:

 - #141980 (Rework `c_variadic`)
 - #146436 (Slice iter cleanup)
 - #148250 (array_chunks: slightly improve docs)
 - #149520 (also introduce Peekable::next_if_map_mut next to next_if_map)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Collaborator

bors commented Dec 2, 2025

⌛ Testing commit 7158f11 with merge c923e31...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-21-3 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

---- [codegen] tests/codegen-llvm/cffi/c-variadic.rs stdout ----
------FileCheck stdout------------------------------

------FileCheck stderr------------------------------
/checkout/tests/codegen-llvm/cffi/c-variadic.rs:30:12: error: CHECK: expected string not found in input
 // CHECK: call void ({{.*}}, ...) @foreign_c_variadic_1({{.*}} %ap)
           ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/cffi/c-variadic/c-variadic.ll:183:76: note: scanning from here
 call void (i32, ...) @foreign_c_variadic_0(i32 0, i32 42, i32 1024, i32 0) #16
                                                                           ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/cffi/c-variadic/c-variadic.ll:193:2: note: possible intended match here
 call void (ptr, ...) @foreign_c_variadic_1(ptr align 8 %0) #16
 ^

Input file: /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/cffi/c-variadic/c-variadic.ll
Check file: /checkout/tests/codegen-llvm/cffi/c-variadic.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
           83:  %_3 = load i32, ptr %self, align 4 
           84:  %_4 = load i32, ptr %other, align 4 
           85:  %_0 = icmp slt i32 %_3, %_4 
           86:  ret i1 %_0 
           87: } 
           88:  
           89: ; <core::ops::range::Range<i32> as core::iter::range::RangeIteratorImpl>::spec_next 
           90: ; Function Attrs: inlinehint nonlazybind uwtable 
           91: define { i32, i32 } @_RNvXs3_NtNtCs4GHKt3AlqPT_4core4iter5rangeINtNtNtB9_3ops5range5RangelENtB5_17RangeIteratorImpl9spec_nextCseeVnCcRg8kZ_10c_variadic(ptr align 4 %self) unnamed_addr #0 { 
           92: start: 
           93:  %_0 = alloca [8 x i8], align 4 
           94:  %_3 = getelementptr inbounds i8, ptr %self, i64 4 
           95: ; call <i32 as core::cmp::PartialOrd>::lt 
           96:  %_2 = call zeroext i1 @_RNvXs1c_NtNtCs4GHKt3AlqPT_4core3cmp5implslNtB8_10PartialOrd2lt(ptr align 4 %_3, ptr align 4 %self) #13 
           97:  br i1 %_2, label %bb2, label %bb4 
           98:  
           99: bb4: ; preds = %start 
          100:  store i32 0, ptr %_0, align 4 
          101:  br label %bb5 
          102:  
          103: bb2: ; preds = %start 
          104:  %0 = getelementptr inbounds i8, ptr %self, i64 4 
          105:  %old = load i32, ptr %0, align 4 
          106: ; call <i32 as core::iter::range::Step>::forward_unchecked 
          107:  %_6 = call i32 @_RNvXsC_NtNtCs4GHKt3AlqPT_4core4iter5rangelNtB5_4Step17forward_uncheckedCseeVnCcRg8kZ_10c_variadic(i32 %old, i64 1) #14 
          108:  %1 = getelementptr inbounds i8, ptr %self, i64 4 
          109:  store i32 %_6, ptr %1, align 4 
          110:  %2 = getelementptr inbounds i8, ptr %_0, i64 4 
          111:  store i32 %old, ptr %2, align 4 
          112:  store i32 1, ptr %_0, align 4 
          113:  br label %bb5 
          114:  
          115: bb5: ; preds = %bb2, %bb4 
          116:  %3 = load i32, ptr %_0, align 4 
          117:  %4 = getelementptr inbounds i8, ptr %_0, i64 4 
          118:  %5 = load i32, ptr %4, align 4 
          119:  %6 = insertvalue { i32, i32 } poison, i32 %3, 0 
          120:  %7 = insertvalue { i32, i32 } %6, i32 %5, 1 
          121:  ret { i32, i32 } %7 
          122: } 
          123:  
          124: ; <core::ops::range::Range<i32> as core::iter::traits::iterator::Iterator>::next 
          125: ; Function Attrs: inlinehint nonlazybind uwtable 
          126: define { i32, i32 } @_RNvXs4_NtNtCs4GHKt3AlqPT_4core4iter5rangeINtNtNtB9_3ops5range5RangelENtNtNtB7_6traits8iterator8Iterator4nextCseeVnCcRg8kZ_10c_variadic(ptr align 4 %self) unnamed_addr #0 { 
          127: start: 
          128: ; call <core::ops::range::Range<i32> as core::iter::range::RangeIteratorImpl>::spec_next 
          129:  %0 = call { i32, i32 } @_RNvXs3_NtNtCs4GHKt3AlqPT_4core4iter5rangeINtNtNtB9_3ops5range5RangelENtB5_17RangeIteratorImpl9spec_nextCseeVnCcRg8kZ_10c_variadic(ptr align 4 %self) #14 
          130:  %_0.0 = extractvalue { i32, i32 } %0, 0 
          131:  %_0.1 = extractvalue { i32, i32 } %0, 1 
          132:  %1 = insertvalue { i32, i32 } poison, i32 %_0.0, 0 
          133:  %2 = insertvalue { i32, i32 } %1, i32 %_0.1, 1 
          134:  ret { i32, i32 } %2 
          135: } 
          136:  
          137: ; <i32 as core::iter::range::Step>::forward_unchecked 
          138: ; Function Attrs: inlinehint nonlazybind uwtable 
          139: define internal i32 @_RNvXsC_NtNtCs4GHKt3AlqPT_4core4iter5rangelNtB5_4Step17forward_uncheckedCseeVnCcRg8kZ_10c_variadic(i32 %start1, i64 %n) unnamed_addr #0 { 
          140: start: 
          141:  %self = alloca [8 x i8], align 4 
          142:  %rhs = trunc i64 %n to i32 
          143:  %0 = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %start1, i32 %rhs) 
          144:  %_8.0 = extractvalue { i32, i1 } %0, 0 
          145:  %_8.1 = extractvalue { i32, i1 } %0, 1 
          146:  %_10 = icmp slt i32 %rhs, 0 
          147:  %b = xor i1 %_8.1, %_10 
          148:  br i1 %b, label %bb1, label %bb3 
          149:  
          150: bb3: ; preds = %start 
          151:  %1 = getelementptr inbounds i8, ptr %self, i64 4 
          152:  store i32 %_8.0, ptr %1, align 4 
          153:  store i32 1, ptr %self, align 4 
          154:  %2 = getelementptr inbounds i8, ptr %self, i64 4 
          155:  %val = load i32, ptr %2, align 4 
          156:  ret i32 %val 
          157:  
          158: bb1: ; preds = %start 
          159:  %3 = load i32, ptr @anon.c55d1b67c275a7c6b18b167e3122ebd6.0, align 4 
          160:  %4 = load i32, ptr getelementptr inbounds (i8, ptr @anon.c55d1b67c275a7c6b18b167e3122ebd6.0, i64 4), align 4 
          161:  store i32 %3, ptr %self, align 4 
          162:  %5 = getelementptr inbounds i8, ptr %self, i64 4 
          163:  store i32 %4, ptr %5, align 4 
          164: ; call core::hint::unreachable_unchecked::precondition_check 
          165:  call void @_RNvNvNtCs4GHKt3AlqPT_4core4hint21unreachable_unchecked18precondition_checkCseeVnCcRg8kZ_10c_variadic(ptr align 8 @alloc_53d9e37674acf8facb30a08952978b9a) #15 
          166:  unreachable 
          167: } 
          168:  
          169: ; <core::ffi::va_list::VaList as core::ops::drop::Drop>::drop 
          170: ; Function Attrs: nonlazybind uwtable 
          171: define internal void @_RNvXsa_NtNtCs4GHKt3AlqPT_4core3ffi7va_listNtB5_6VaListNtNtNtB9_3ops4drop4Drop4dropCseeVnCcRg8kZ_10c_variadic(ptr align 8 %self) unnamed_addr #1 { 
          172: start: 
          173:  ret void 
          174: } 
          175:  
          176: ; c_variadic::use_foreign_c_variadic_0 
          177: ; Function Attrs: nounwind nonlazybind uwtable 
          178: define void @_RNvCseeVnCcRg8kZ_10c_variadic24use_foreign_c_variadic_0() unnamed_addr #5 { 
          179: start: 
          180:  call void (i32, ...) @foreign_c_variadic_0(i32 0) #16 
          181:  call void (i32, ...) @foreign_c_variadic_0(i32 0, i32 42) #16 
          182:  call void (i32, ...) @foreign_c_variadic_0(i32 0, i32 42, i32 1024) #16 
          183:  call void (i32, ...) @foreign_c_variadic_0(i32 0, i32 42, i32 1024, i32 0) #16 
check:30'0                                                                                X~~~~ error: no match found
          184:  ret void 
check:30'0     ~~~~~~~~~~
          185: } 
check:30'0     ~~
          186:  
check:30'0     ~
          187: ; c_variadic::use_foreign_c_variadic_1_0 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          188: ; Function Attrs: nounwind nonlazybind uwtable 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          189: define void @_RNvCseeVnCcRg8kZ_10c_variadic26use_foreign_c_variadic_1_0(ptr align 8 %ap) unnamed_addr #5 { 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          190: start: 
check:30'0     ~~~~~~~
          191:  %0 = alloca [24 x i8], align 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          192:  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %ap, i64 24, i1 false) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          193:  call void (ptr, ...) @foreign_c_variadic_1(ptr align 8 %0) #16 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:30'1      ?                                                               possible intended match
          194:  ret void 
check:30'0     ~~~~~~~~~~
          195: } 
check:30'0     ~~
          196:  
check:30'0     ~
          197: ; c_variadic::use_foreign_c_variadic_1_1 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          198: ; Function Attrs: nounwind nonlazybind uwtable 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          199: define void @_RNvCseeVnCcRg8kZ_10c_variadic26use_foreign_c_variadic_1_1(ptr align 8 %ap) unnamed_addr #5 { 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          200: start: 
check:30'0     ~~~~~~~
          201:  %0 = alloca [24 x i8], align 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          202:  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %ap, i64 24, i1 false) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          203:  call void (ptr, ...) @foreign_c_variadic_1(ptr align 8 %0, i32 42) #16 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          204:  ret void 
check:30'0     ~~~~~~~~~~
          205: } 
check:30'0     ~~
          206:  
check:30'0     ~
          207: ; c_variadic::use_foreign_c_variadic_1_2 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          208: ; Function Attrs: nounwind nonlazybind uwtable 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          209: define void @_RNvCseeVnCcRg8kZ_10c_variadic26use_foreign_c_variadic_1_2(ptr align 8 %ap) unnamed_addr #5 { 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          210: start: 
check:30'0     ~~~~~~~
          211:  %0 = alloca [24 x i8], align 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          212:  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %ap, i64 24, i1 false) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          213:  call void (ptr, ...) @foreign_c_variadic_1(ptr align 8 %0, i32 2, i32 42) #16 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          214:  ret void 
check:30'0     ~~~~~~~~~~
          215: } 
check:30'0     ~~
          216:  
check:30'0     ~
          217: ; c_variadic::use_foreign_c_variadic_1_3 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          218: ; Function Attrs: nounwind nonlazybind uwtable 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          219: define void @_RNvCseeVnCcRg8kZ_10c_variadic26use_foreign_c_variadic_1_3(ptr align 8 %ap) unnamed_addr #5 { 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          220: start: 
check:30'0     ~~~~~~~
          221:  %0 = alloca [24 x i8], align 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          222:  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %ap, i64 24, i1 false) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          223:  call void (ptr, ...) @foreign_c_variadic_1(ptr align 8 %0, i32 2, i32 42, i32 0) #16 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          224:  ret void 
check:30'0     ~~~~~~~~~~
          225: } 
check:30'0     ~~
          226:  
check:30'0     ~
          227: ; Function Attrs: nounwind nonlazybind uwtable 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          228: define i32 @c_variadic(i32 %n, ...) unnamed_addr #5 personality ptr @rust_eh_personality { 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          229: start: 
check:30'0     ~~~~~~~
          230:  %0 = alloca [16 x i8], align 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          231:  %iter = alloca [8 x i8], align 4 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          232:  %sum = alloca [4 x i8], align 4 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          233:  %ap = alloca [24 x i8], align 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          234:  call void @llvm.va_start.p0(ptr %ap) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          235:  store i32 0, ptr %sum, align 4 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          236: ; invoke <core::ops::range::Range<i32> as core::iter::traits::collect::IntoIterator>::into_iter 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          237:  %1 = invoke { i32, i32 } @_RNvXNtNtNtCs4GHKt3AlqPT_4core4iter6traits7collectINtNtNtB8_3ops5range5RangelENtB2_12IntoIterator9into_iterCseeVnCcRg8kZ_10c_variadic(i32 %n, i32 0) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          238:  to label %bb1 unwind label %cleanup 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          239:  
check:30'0     ~
          240: bb9: ; preds = %cleanup 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~
          241: ; invoke core::ptr::drop_in_place::<core::ffi::va_list::VaList> 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          242:  invoke void @_RINvNtCs4GHKt3AlqPT_4core3ptr13drop_in_placeNtNtNtB4_3ffi7va_list6VaListECseeVnCcRg8kZ_10c_variadic(ptr align 8 %ap) #17 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          243:  to label %bb10 unwind label %terminate 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          244:  
check:30'0     ~
          245: cleanup: ; preds = %bb5, %bb2, %start 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          246:  %2 = landingpad { ptr, i32 } 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          247:  cleanup 
check:30'0     ~~~~~~~~~
          248:  %3 = extractvalue { ptr, i32 } %2, 0 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          249:  %4 = extractvalue { ptr, i32 } %2, 1 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          250:  store ptr %3, ptr %0, align 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          251:  %5 = getelementptr inbounds i8, ptr %0, i64 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          252:  store i32 %4, ptr %5, align 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          253:  br label %bb9 
check:30'0     ~~~~~~~~~~~~~~~
          254:  
check:30'0     ~
          255: bb1: ; preds = %start 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~
          256:  %_4.0 = extractvalue { i32, i32 } %1, 0 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          257:  %_4.1 = extractvalue { i32, i32 } %1, 1 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          258:  store i32 %_4.0, ptr %iter, align 4 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          259:  %6 = getelementptr inbounds i8, ptr %iter, i64 4 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          260:  store i32 %_4.1, ptr %6, align 4 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          261:  br label %bb2 
check:30'0     ~~~~~~~~~~~~~~~
          262:  
check:30'0     ~
          263: bb2: ; preds = %bb7, %bb1 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
          264: ; invoke <core::ops::range::Range<i32> as core::iter::traits::iterator::Iterator>::next 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          265:  %7 = invoke { i32, i32 } @_RNvXs4_NtNtCs4GHKt3AlqPT_4core4iter5rangeINtNtNtB9_3ops5range5RangelENtNtNtB7_6traits8iterator8Iterator4nextCseeVnCcRg8kZ_10c_variadic(ptr align 4 %iter) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          266:  to label %bb3 unwind label %cleanup 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          267:  
check:30'0     ~
          268: bb3: ; preds = %bb2 
check:30'0     ~~~~~~~~~~~~~~~~~~~~
          269:  %_7.0 = extractvalue { i32, i32 } %7, 0 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          270:  %_7.1 = extractvalue { i32, i32 } %7, 1 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          271:  %_9 = zext i32 %_7.0 to i64 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          272:  %8 = trunc nuw i64 %_9 to i1 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          273:  br i1 %8, label %bb5, label %bb6 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          274:  
check:30'0     ~
          275: bb5: ; preds = %bb3 
check:30'0     ~~~~~~~~~~~~~~~~~~~~
          276: ; invoke <core::ffi::va_list::VaList>::arg::<i32> 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          277:  %_10 = invoke i32 @_RINvMs8_NtNtCs4GHKt3AlqPT_4core3ffi7va_listNtB6_6VaList3arglECseeVnCcRg8kZ_10c_variadic(ptr align 8 %ap) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          278:  to label %bb7 unwind label %cleanup 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          279:  
check:30'0     ~
          280: bb6: ; preds = %bb3 
check:30'0     ~~~~~~~~~~~~~~~~~~~~
          281:  %_0 = load i32, ptr %sum, align 4 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          282: ; invoke core::ptr::drop_in_place::<core::ffi::va_list::VaList> 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          283:  invoke void @_RINvNtCs4GHKt3AlqPT_4core3ptr13drop_in_placeNtNtNtB4_3ffi7va_list6VaListECseeVnCcRg8kZ_10c_variadic(ptr align 8 %ap) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          284:  to label %bb8 unwind label %cleanup1 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          285:  
check:30'0     ~
          286: bb10: ; preds = %bb9, %cleanup1 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          287: ; call core::panicking::panic_cannot_unwind 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          288:  call void @_RNvNtCs4GHKt3AlqPT_4core9panicking19panic_cannot_unwind() #18 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          289:  unreachable 
check:30'0     ~~~~~~~~~~~~~
          290:  
check:30'0     ~
          291: cleanup1: ; preds = %bb6 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
          292:  %9 = landingpad { ptr, i32 } 
---
>>>>>>

------------------------------------------

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/usr/lib/llvm-21/bin/FileCheck" "--input-file" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/cffi/c-variadic/c-variadic.ll" "/checkout/tests/codegen-llvm/cffi/c-variadic.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/checkout/tests/codegen-llvm/cffi/c-variadic.rs:30:12: error: CHECK: expected string not found in input
 // CHECK: call void ({{.*}}, ...) @foreign_c_variadic_1({{.*}} %ap)
           ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/cffi/c-variadic/c-variadic.ll:183:76: note: scanning from here
 call void (i32, ...) @foreign_c_variadic_0(i32 0, i32 42, i32 1024, i32 0) #16
                                                                           ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/cffi/c-variadic/c-variadic.ll:193:2: note: possible intended match here
 call void (ptr, ...) @foreign_c_variadic_1(ptr align 8 %0) #16
 ^

Input file: /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/cffi/c-variadic/c-variadic.ll
Check file: /checkout/tests/codegen-llvm/cffi/c-variadic.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
           83:  %_3 = load i32, ptr %self, align 4 
           84:  %_4 = load i32, ptr %other, align 4 
           85:  %_0 = icmp slt i32 %_3, %_4 
           86:  ret i1 %_0 
           87: } 
           88:  
           89: ; <core::ops::range::Range<i32> as core::iter::range::RangeIteratorImpl>::spec_next 
           90: ; Function Attrs: inlinehint nonlazybind uwtable 
           91: define { i32, i32 } @_RNvXs3_NtNtCs4GHKt3AlqPT_4core4iter5rangeINtNtNtB9_3ops5range5RangelENtB5_17RangeIteratorImpl9spec_nextCseeVnCcRg8kZ_10c_variadic(ptr align 4 %self) unnamed_addr #0 { 
           92: start: 
           93:  %_0 = alloca [8 x i8], align 4 
           94:  %_3 = getelementptr inbounds i8, ptr %self, i64 4 
           95: ; call <i32 as core::cmp::PartialOrd>::lt 
           96:  %_2 = call zeroext i1 @_RNvXs1c_NtNtCs4GHKt3AlqPT_4core3cmp5implslNtB8_10PartialOrd2lt(ptr align 4 %_3, ptr align 4 %self) #13 
           97:  br i1 %_2, label %bb2, label %bb4 
           98:  
           99: bb4: ; preds = %start 
          100:  store i32 0, ptr %_0, align 4 
          101:  br label %bb5 
          102:  
          103: bb2: ; preds = %start 
          104:  %0 = getelementptr inbounds i8, ptr %self, i64 4 
          105:  %old = load i32, ptr %0, align 4 
          106: ; call <i32 as core::iter::range::Step>::forward_unchecked 
          107:  %_6 = call i32 @_RNvXsC_NtNtCs4GHKt3AlqPT_4core4iter5rangelNtB5_4Step17forward_uncheckedCseeVnCcRg8kZ_10c_variadic(i32 %old, i64 1) #14 
          108:  %1 = getelementptr inbounds i8, ptr %self, i64 4 
          109:  store i32 %_6, ptr %1, align 4 
          110:  %2 = getelementptr inbounds i8, ptr %_0, i64 4 
          111:  store i32 %old, ptr %2, align 4 
          112:  store i32 1, ptr %_0, align 4 
          113:  br label %bb5 
          114:  
          115: bb5: ; preds = %bb2, %bb4 
          116:  %3 = load i32, ptr %_0, align 4 
          117:  %4 = getelementptr inbounds i8, ptr %_0, i64 4 
          118:  %5 = load i32, ptr %4, align 4 
          119:  %6 = insertvalue { i32, i32 } poison, i32 %3, 0 
          120:  %7 = insertvalue { i32, i32 } %6, i32 %5, 1 
          121:  ret { i32, i32 } %7 
          122: } 
          123:  
          124: ; <core::ops::range::Range<i32> as core::iter::traits::iterator::Iterator>::next 
          125: ; Function Attrs: inlinehint nonlazybind uwtable 
          126: define { i32, i32 } @_RNvXs4_NtNtCs4GHKt3AlqPT_4core4iter5rangeINtNtNtB9_3ops5range5RangelENtNtNtB7_6traits8iterator8Iterator4nextCseeVnCcRg8kZ_10c_variadic(ptr align 4 %self) unnamed_addr #0 { 
          127: start: 
          128: ; call <core::ops::range::Range<i32> as core::iter::range::RangeIteratorImpl>::spec_next 
          129:  %0 = call { i32, i32 } @_RNvXs3_NtNtCs4GHKt3AlqPT_4core4iter5rangeINtNtNtB9_3ops5range5RangelENtB5_17RangeIteratorImpl9spec_nextCseeVnCcRg8kZ_10c_variadic(ptr align 4 %self) #14 
          130:  %_0.0 = extractvalue { i32, i32 } %0, 0 
          131:  %_0.1 = extractvalue { i32, i32 } %0, 1 
          132:  %1 = insertvalue { i32, i32 } poison, i32 %_0.0, 0 
          133:  %2 = insertvalue { i32, i32 } %1, i32 %_0.1, 1 
          134:  ret { i32, i32 } %2 
          135: } 
          136:  
          137: ; <i32 as core::iter::range::Step>::forward_unchecked 
          138: ; Function Attrs: inlinehint nonlazybind uwtable 
          139: define internal i32 @_RNvXsC_NtNtCs4GHKt3AlqPT_4core4iter5rangelNtB5_4Step17forward_uncheckedCseeVnCcRg8kZ_10c_variadic(i32 %start1, i64 %n) unnamed_addr #0 { 
          140: start: 
          141:  %self = alloca [8 x i8], align 4 
          142:  %rhs = trunc i64 %n to i32 
          143:  %0 = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %start1, i32 %rhs) 
          144:  %_8.0 = extractvalue { i32, i1 } %0, 0 
          145:  %_8.1 = extractvalue { i32, i1 } %0, 1 
          146:  %_10 = icmp slt i32 %rhs, 0 
          147:  %b = xor i1 %_8.1, %_10 
          148:  br i1 %b, label %bb1, label %bb3 
          149:  
          150: bb3: ; preds = %start 
          151:  %1 = getelementptr inbounds i8, ptr %self, i64 4 
          152:  store i32 %_8.0, ptr %1, align 4 
          153:  store i32 1, ptr %self, align 4 
          154:  %2 = getelementptr inbounds i8, ptr %self, i64 4 
          155:  %val = load i32, ptr %2, align 4 
          156:  ret i32 %val 
          157:  
          158: bb1: ; preds = %start 
          159:  %3 = load i32, ptr @anon.c55d1b67c275a7c6b18b167e3122ebd6.0, align 4 
          160:  %4 = load i32, ptr getelementptr inbounds (i8, ptr @anon.c55d1b67c275a7c6b18b167e3122ebd6.0, i64 4), align 4 
          161:  store i32 %3, ptr %self, align 4 
          162:  %5 = getelementptr inbounds i8, ptr %self, i64 4 
          163:  store i32 %4, ptr %5, align 4 
          164: ; call core::hint::unreachable_unchecked::precondition_check 
          165:  call void @_RNvNvNtCs4GHKt3AlqPT_4core4hint21unreachable_unchecked18precondition_checkCseeVnCcRg8kZ_10c_variadic(ptr align 8 @alloc_53d9e37674acf8facb30a08952978b9a) #15 
          166:  unreachable 
          167: } 
          168:  
          169: ; <core::ffi::va_list::VaList as core::ops::drop::Drop>::drop 
          170: ; Function Attrs: nonlazybind uwtable 
          171: define internal void @_RNvXsa_NtNtCs4GHKt3AlqPT_4core3ffi7va_listNtB5_6VaListNtNtNtB9_3ops4drop4Drop4dropCseeVnCcRg8kZ_10c_variadic(ptr align 8 %self) unnamed_addr #1 { 
          172: start: 
          173:  ret void 
          174: } 
          175:  
          176: ; c_variadic::use_foreign_c_variadic_0 
          177: ; Function Attrs: nounwind nonlazybind uwtable 
          178: define void @_RNvCseeVnCcRg8kZ_10c_variadic24use_foreign_c_variadic_0() unnamed_addr #5 { 
          179: start: 
          180:  call void (i32, ...) @foreign_c_variadic_0(i32 0) #16 
          181:  call void (i32, ...) @foreign_c_variadic_0(i32 0, i32 42) #16 
          182:  call void (i32, ...) @foreign_c_variadic_0(i32 0, i32 42, i32 1024) #16 
          183:  call void (i32, ...) @foreign_c_variadic_0(i32 0, i32 42, i32 1024, i32 0) #16 
check:30'0                                                                                X~~~~ error: no match found
          184:  ret void 
check:30'0     ~~~~~~~~~~
          185: } 
check:30'0     ~~
          186:  
check:30'0     ~
          187: ; c_variadic::use_foreign_c_variadic_1_0 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          188: ; Function Attrs: nounwind nonlazybind uwtable 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          189: define void @_RNvCseeVnCcRg8kZ_10c_variadic26use_foreign_c_variadic_1_0(ptr align 8 %ap) unnamed_addr #5 { 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          190: start: 
check:30'0     ~~~~~~~
          191:  %0 = alloca [24 x i8], align 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          192:  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %ap, i64 24, i1 false) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          193:  call void (ptr, ...) @foreign_c_variadic_1(ptr align 8 %0) #16 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:30'1      ?                                                               possible intended match
          194:  ret void 
check:30'0     ~~~~~~~~~~
          195: } 
check:30'0     ~~
          196:  
check:30'0     ~
          197: ; c_variadic::use_foreign_c_variadic_1_1 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          198: ; Function Attrs: nounwind nonlazybind uwtable 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          199: define void @_RNvCseeVnCcRg8kZ_10c_variadic26use_foreign_c_variadic_1_1(ptr align 8 %ap) unnamed_addr #5 { 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          200: start: 
check:30'0     ~~~~~~~
          201:  %0 = alloca [24 x i8], align 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          202:  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %ap, i64 24, i1 false) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          203:  call void (ptr, ...) @foreign_c_variadic_1(ptr align 8 %0, i32 42) #16 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          204:  ret void 
check:30'0     ~~~~~~~~~~
          205: } 
check:30'0     ~~
          206:  
check:30'0     ~
          207: ; c_variadic::use_foreign_c_variadic_1_2 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          208: ; Function Attrs: nounwind nonlazybind uwtable 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          209: define void @_RNvCseeVnCcRg8kZ_10c_variadic26use_foreign_c_variadic_1_2(ptr align 8 %ap) unnamed_addr #5 { 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          210: start: 
check:30'0     ~~~~~~~
          211:  %0 = alloca [24 x i8], align 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          212:  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %ap, i64 24, i1 false) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          213:  call void (ptr, ...) @foreign_c_variadic_1(ptr align 8 %0, i32 2, i32 42) #16 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          214:  ret void 
check:30'0     ~~~~~~~~~~
          215: } 
check:30'0     ~~
          216:  
check:30'0     ~
          217: ; c_variadic::use_foreign_c_variadic_1_3 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          218: ; Function Attrs: nounwind nonlazybind uwtable 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          219: define void @_RNvCseeVnCcRg8kZ_10c_variadic26use_foreign_c_variadic_1_3(ptr align 8 %ap) unnamed_addr #5 { 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          220: start: 
check:30'0     ~~~~~~~
          221:  %0 = alloca [24 x i8], align 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          222:  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %ap, i64 24, i1 false) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          223:  call void (ptr, ...) @foreign_c_variadic_1(ptr align 8 %0, i32 2, i32 42, i32 0) #16 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          224:  ret void 
check:30'0     ~~~~~~~~~~
          225: } 
check:30'0     ~~
          226:  
check:30'0     ~
          227: ; Function Attrs: nounwind nonlazybind uwtable 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          228: define i32 @c_variadic(i32 %n, ...) unnamed_addr #5 personality ptr @rust_eh_personality { 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          229: start: 
check:30'0     ~~~~~~~
          230:  %0 = alloca [16 x i8], align 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          231:  %iter = alloca [8 x i8], align 4 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          232:  %sum = alloca [4 x i8], align 4 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          233:  %ap = alloca [24 x i8], align 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          234:  call void @llvm.va_start.p0(ptr %ap) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          235:  store i32 0, ptr %sum, align 4 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          236: ; invoke <core::ops::range::Range<i32> as core::iter::traits::collect::IntoIterator>::into_iter 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          237:  %1 = invoke { i32, i32 } @_RNvXNtNtNtCs4GHKt3AlqPT_4core4iter6traits7collectINtNtNtB8_3ops5range5RangelENtB2_12IntoIterator9into_iterCseeVnCcRg8kZ_10c_variadic(i32 %n, i32 0) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          238:  to label %bb1 unwind label %cleanup 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          239:  
check:30'0     ~
          240: bb9: ; preds = %cleanup 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~
          241: ; invoke core::ptr::drop_in_place::<core::ffi::va_list::VaList> 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          242:  invoke void @_RINvNtCs4GHKt3AlqPT_4core3ptr13drop_in_placeNtNtNtB4_3ffi7va_list6VaListECseeVnCcRg8kZ_10c_variadic(ptr align 8 %ap) #17 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          243:  to label %bb10 unwind label %terminate 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          244:  
check:30'0     ~
          245: cleanup: ; preds = %bb5, %bb2, %start 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          246:  %2 = landingpad { ptr, i32 } 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          247:  cleanup 
check:30'0     ~~~~~~~~~
          248:  %3 = extractvalue { ptr, i32 } %2, 0 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          249:  %4 = extractvalue { ptr, i32 } %2, 1 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          250:  store ptr %3, ptr %0, align 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          251:  %5 = getelementptr inbounds i8, ptr %0, i64 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          252:  store i32 %4, ptr %5, align 8 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          253:  br label %bb9 
check:30'0     ~~~~~~~~~~~~~~~
          254:  
check:30'0     ~
          255: bb1: ; preds = %start 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~
          256:  %_4.0 = extractvalue { i32, i32 } %1, 0 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          257:  %_4.1 = extractvalue { i32, i32 } %1, 1 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          258:  store i32 %_4.0, ptr %iter, align 4 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          259:  %6 = getelementptr inbounds i8, ptr %iter, i64 4 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          260:  store i32 %_4.1, ptr %6, align 4 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          261:  br label %bb2 
check:30'0     ~~~~~~~~~~~~~~~
          262:  
check:30'0     ~
          263: bb2: ; preds = %bb7, %bb1 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
          264: ; invoke <core::ops::range::Range<i32> as core::iter::traits::iterator::Iterator>::next 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          265:  %7 = invoke { i32, i32 } @_RNvXs4_NtNtCs4GHKt3AlqPT_4core4iter5rangeINtNtNtB9_3ops5range5RangelENtNtNtB7_6traits8iterator8Iterator4nextCseeVnCcRg8kZ_10c_variadic(ptr align 4 %iter) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          266:  to label %bb3 unwind label %cleanup 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          267:  
check:30'0     ~
          268: bb3: ; preds = %bb2 
check:30'0     ~~~~~~~~~~~~~~~~~~~~
          269:  %_7.0 = extractvalue { i32, i32 } %7, 0 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          270:  %_7.1 = extractvalue { i32, i32 } %7, 1 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          271:  %_9 = zext i32 %_7.0 to i64 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          272:  %8 = trunc nuw i64 %_9 to i1 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          273:  br i1 %8, label %bb5, label %bb6 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          274:  
check:30'0     ~
          275: bb5: ; preds = %bb3 
check:30'0     ~~~~~~~~~~~~~~~~~~~~
          276: ; invoke <core::ffi::va_list::VaList>::arg::<i32> 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          277:  %_10 = invoke i32 @_RINvMs8_NtNtCs4GHKt3AlqPT_4core3ffi7va_listNtB6_6VaList3arglECseeVnCcRg8kZ_10c_variadic(ptr align 8 %ap) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          278:  to label %bb7 unwind label %cleanup 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          279:  
check:30'0     ~
          280: bb6: ; preds = %bb3 
check:30'0     ~~~~~~~~~~~~~~~~~~~~
          281:  %_0 = load i32, ptr %sum, align 4 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          282: ; invoke core::ptr::drop_in_place::<core::ffi::va_list::VaList> 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          283:  invoke void @_RINvNtCs4GHKt3AlqPT_4core3ptr13drop_in_placeNtNtNtB4_3ffi7va_list6VaListECseeVnCcRg8kZ_10c_variadic(ptr align 8 %ap) 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          284:  to label %bb8 unwind label %cleanup1 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          285:  
check:30'0     ~
          286: bb10: ; preds = %bb9, %cleanup1 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          287: ; call core::panicking::panic_cannot_unwind 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          288:  call void @_RNvNtCs4GHKt3AlqPT_4core9panicking19panic_cannot_unwind() #18 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          289:  unreachable 
check:30'0     ~~~~~~~~~~~~~
          290:  
check:30'0     ~
          291: cleanup1: ; preds = %bb6 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
          292:  %9 = landingpad { ptr, i32 } 

@bors
Copy link
Collaborator

bors commented Dec 2, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 2, 2025
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants